{% extends "layouts/layout.html" %}
{% block title %}
My Items
{% endblock %}
{% block content %}
<h3>My Items</h3>
<hr />
<table class="table table-striped">
  <tr>
    <th width="15%">Expiration Date</th><th>Title</th><th>Edit</th><th>Delete</th>
  </tr>
	{% for item in items %}
	<tr>
    <td>{{item.expiration_date.strftime("%m/%d/%Y")}}</td>
		<td>
			<a href="/items/view_item?item_id={{ item.key().id() }}">
				<div>{{ item.title }}</div>
			</a>
		</td>
    <td>
      <div><a class="btn" href="/items/edit_item?item_id={{ item.key().id() }}">Edit Item</a></div>
    </td>
    <td>
      <div><a class="btn" href="/items/delete_item?item_id={{ item.key().id() }}&xsrf_token={{ xsrf_token }}" onclick="return confirm('Are you sure?');">Delete Item</a></div>
    </td>
	</tr>
	{% endfor %}
</table>
<p><a class="btn" href="/items/new_item">New Item</a></p>
{% endblock %}
